package engine.math
{
	import engine.core.*;
	
	public class RxPlane
	{
		public var v:RxVector4;
		private static var s_tmp0:RxPlane = new RxPlane(0, 0, 0, 0);
		private static var s_tmp1:RxPlane = new RxPlane(0, 0, 0, 0);
		private static var s_pool:RxObjectPool = null;
		
		public function RxPlane(x:Number, y:Number, z:Number, w:Number)
		{
			this.v = new RxVector4(x, y, z, w);
		}
		
		public static function CreatePool(initSize:uint, growSize:uint) : void
		{
			var allocFunc:* = function () : Object
			{
				return new RxPlane(0, 0, 0, 0);
			};
			
			s_pool = new RxObjectPool(allocFunc, null, initSize, growSize, RxPlane);
		}
		
		public function Normalize() : void
		{
			var mag:Number = this.v.Magnitude3();
			RxVector4.DivScalar(this.v, this.v, mag);
		}
	}
}